import requests, urllib3

urllib3.disable_warnings()   # 不收到警告信息

base_url = 'https://data.stats.gov.cn/'
header = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.86'
}

response = requests.get(base_url, headers=header, verify=False)   # 将verify参数设置为False
print(response.status_code)